package com.vortexinfo.demos;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.FileNameMap;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.security.cert.Certificate;
import java.sql.ClientInfoStatus;

import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLPeerUnverifiedException;

import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.HttpMethod;
import org.apache.commons.httpclient.methods.MultipartPostMethod;
import org.apache.commons.httpclient.methods.PostMethod;

public class BMap_PIO {

	public static void main(String[] args) throws HttpException, IOException {

		HttpClient httpClient = new HttpClient();
		HttpMethod method = new PostMethod("http://api.map.baidu.com/geodata/v3/poi/upload");
		method.getParams().setParameter("geotable_id", "86581");
		method.getParams().setParameter("ak", "n7WHOPAEzAq3C5a86MkfD2sZ");
		method.getParams().setParameter("poi_list", new FileInputStream(new File("C://Users//USER//Desktop//databox_86692.csv")));

		int code = httpClient.executeMethod(method);
		String response = new String(method.getResponseBody());
		System.out.println("code:" + code + "response" + response);
	}
}
